#include "CF_Core.h"

CCF_VectorCamera::CCF_VectorCamera(void)
{
  m_vRight = D3DXVECTOR3(-1.0f, 0.0f, 0.0f);
}

CCF_VectorCamera::~CCF_VectorCamera(void)
{
}

void CCF_VectorCamera::Move(float fAmnt)
{
  m_position += m_direction*fAmnt;
}

void CCF_VectorCamera::Strafe(float fAmnt)
{
  m_position += m_vRight*fAmnt;
}

void CCF_VectorCamera::Jump(float fAmnt)
{
  //fAmnt *= elapsedTime;
  m_position += m_up*fAmnt;
  //m_vEye.z += 20.0f;
}
void CCF_VectorCamera::Down(float fAmnt)
{
  m_position += m_up*fAmnt;
}

void CCF_VectorCamera::Rotate(float fXAmnt, float fYAmnt)
{
  D3DXMATRIX mtxRot;

  D3DXMatrixRotationAxis( &mtxRot, &m_vRight, D3DXToRadian(fYAmnt) );

  D3DXVec3TransformCoord( &m_direction, &m_direction, &mtxRot );
  D3DXVec3TransformCoord( &m_up, &m_up, &mtxRot );

  D3DXMatrixRotationAxis( &mtxRot, &D3DXVECTOR3(0,0,1),D3DXToRadian(fXAmnt) );
  D3DXVec3TransformCoord( &m_direction, &m_direction, &mtxRot );
  D3DXVec3TransformCoord( &m_up, &m_up, &mtxRot );
}